package test;

import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;

import remote_work.dto.InputObject;
import remote_work.dto.OutputObject;

/**
 * @author LiuPing
 *
 * 2018年3月21日
 */
public class Client {

	public static void main(String[] args) throws Exception {
		Socket s = new Socket("127.0.0.1", 8080);
		
		ObjectOutputStream oos = new ObjectOutputStream(s.getOutputStream());
		InputObject io = new InputObject();
		io.setMethod("method");
		oos.writeObject(io);
		
		ObjectInputStream ois = new ObjectInputStream(s.getInputStream());
		OutputObject oo = (OutputObject) ois.readObject();
		System.out.println(oo.getReturnMessage());
	}
}
